<?php

/*

  Action - Victory	$6

  Worth 2 VP
  Choose one: +3 Cards; or +2 Actions.

 */

class Nobles extends Card implements iVictory, iAction, iKingdom, iIntrigue {

    public function __construct() {
        parent::__construct("Nobles", 6);
        $this->victoryPoints = 2;
        $this->undoPlay = false;
        $this->undoBuy = true;
    }

    public function getDisplayName($quantity = 1) {
        if ($quantity == 1) {
            return "Nobles";
        }
        return $quantity . " Nobles";
    }
    
    public function getDescription() {
        return array(
            "Worth 2 VP",
            "Choose one: +3 Cards; or +2 Actions.");
    }
    
    public function play(Game $game, $isRealCard) {
        $options = array(new Option(1, '2 Actions'), new Option(2, '3 Cards'));
        
        $output = MySocket::GetUserReply($game,  Input_ChooseOne,  $options, 1, 1, null, "Please choose");
        $answer = $output[0];

        if ($answer == '2 Actions') {
            $game->addActions(2);
             ScreenDisplay::addScreenMessage($game, true, "get +2 action", "gets +2 actions");
        } else {
            $drawed_cards = $game->drawCards(3);
             ScreenDisplay::addScreenMessage($game, true, "draw ".  nicePrint($drawed_cards), "draws ".sizeof($drawed_cards). " cards");
        }
        $game->cardActionFinished();
        return true;
    }
}

?>